package com.cloud.advice.domain.exception;

/**
 * <pre>
 *  异常类
 * </pre>
 */
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = -8314528091521220589L;
    public static final int ERROR_CODE = 500;
    private int errorCode = 500;

    public BusinessException() {
        super();
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(int errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public BusinessException(int errorCode, String message, Throwable throwable) {
        super(message, throwable);
        this.errorCode = errorCode;
    }

    public BusinessException(int errorCode, Throwable throwable) {
        this(errorCode, throwable.getMessage(), throwable);
    }

    public int getErrorCode() {
        return errorCode;
    }

}
